package com.woniuxy.returnQue;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.woniuxy.utils.Utils;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

public class ReturnDelare {
    public static void main(String[] args) throws IOException, TimeoutException {
        //创建连接对象
        Connection connection = Utils.getConnection();
        //创建通道
        Channel channel = connection.createChannel();
        //创建交换机
        channel.exchangeDeclare("returnExchange", BuiltinExchangeType.DIRECT);
        //创建队列
        channel.queueDeclare("retuenQueue",false,false,false,null);
        //队列绑定交换机
        channel.queueBind("retuenQueue","returnExchange","return1");

        channel.close();
        connection.close();
    }
}
